﻿using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;


namespace CPPProject.CPP
{
    /// <summary>
    /// 资产流传
    /// </summary>
    [Table("CPPPartTrans")]
    public class CPPPartTrans : Entity<Guid>, IHasCreationTime, IMustHaveTenant, IModificationAudited
    {
        public int TenantId { get; set; }
        public DateTime CreationTime { get; set; }
        public long? LastModifierUserId { get; set; }
        public DateTime? LastModificationTime { get; set; }
        /// <summary>
        /// 所属公司
        /// </summary>
        public long CompanyId { get; set; }
        [ForeignKey("CompanyId")]
        public virtual CPPCompany TCompany { get; set; }
        /// <summary>
        /// 流转单号
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string TransNum { get; set; }
        /// <summary>
        /// 资产编码
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string PartNum { get; set; }
        /// <summary>
        /// 资产类型
        /// </summary>
        [MaxLength(10)]
        public string PType { get; set; }
        /// <summary>
        /// 订单编号
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string OrderNum { get; set; }
        /// <summary>
        /// 合同编号
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string ContractNum { get; set; }
        /// <summary>
        /// 流转状态（0待处理1备货2在途3已接收4已完成5已取消6指派运输7等待接货8待确认发货）
        /// </summary>
        [MaxLength(10)]
        public string Status { get; set; }
        /// <summary>
        /// 发出站点
        /// </summary>
        [MaxLength(300)]
        public string FromPlantId { get; set; }
        /// <summary>
        /// 接收站点
        /// </summary>
        [MaxLength(300)]
        public string ToPlantId { get; set; }
        /// <summary>
        /// 单据日期
        /// </summary>
        public DateTime OrderDate { get; set; }
        /// <summary>
        /// 到货日期
        /// </summary>
        public DateTime DeliveryDate { get; set; }
        /// <summary>
        /// 承运商编码
        /// </summary>
        [MaxLength(50)]
        public string CarrierNum { get; set; }
        /// <summary>
        /// 承运商ID
        /// </summary>
        public int CarrierId { get; set; }
        /// <summary>
        /// 客户编码
        /// </summary>
        [MaxLength(50)]
        public string CustNum { get; set; }
        /// <summary>
        /// 客户ID
        /// </summary>
        public long CustId { get; set; }
        /// <summary>
        /// 状态变更日期
        /// </summary>
        public DateTime? StatusChangeDate { get; set; }
        /// <summary>
        /// 状态变更人
        /// </summary>
        [MaxLength(300)]
        public string StatusChangeUser { get; set; }
        /// <summary>
        /// 类型（0未知1发出2回收3调拨4增资5报废6灭失7客户流转）
        /// </summary>
        [MaxLength(10)]
        public string IType { get; set; }
        /// <summary>
        ///  备注
        /// </summary>
        [MaxLength(300)]
        public string Remark { get; set; }
        /// <summary>
        /// 司机姓名
        /// </summary>
        [MaxLength(50)]
        public string DriverName { get; set; }
        /// <summary>
        /// 联系方式
        /// </summary>
        [MaxLength(300)]
        public string Telphone { get; set; }
        /// <summary>
        /// 车牌号
        /// </summary>
        [MaxLength(300)]
        public string CarId { get; set; }
        /// <summary>
        /// 数量
        /// </summary>
        public decimal Quantity { get; set; }
        /// <summary>
        /// 单价
        /// </summary>
        public decimal UnitPrice { get; set; }
        /// <summary>
        /// 总价
        /// </summary>
        public decimal Amount { get; set; }        
        /// <summary>
        /// 关联单据
        /// </summary>
        [MaxLength(300)]
        public string RelationData { get; set; }
        /// <summary>
        /// 发送时间
        /// </summary>
        public DateTime? SendDate { get; set; }
        /// <summary>
        /// 运输方式
        /// </summary>
        [MaxLength(10)]
        public string TransMode { get; set; }
        /// <summary>
        /// 司机联系电话
        /// </summary>
        [MaxLength(300)]
        public string DriverPhone { get; set; }
        /// <summary>
        /// 合同里的项目路线
        /// </summary>
        [MaxLength(300)]
        public string ProjectName { get; set; }
        /// <summary>
        /// 业务类型
        /// </summary>
        [MaxLength(10)]
        public string BusType { get; set; }
        /// <summary>
        /// 是否订单复制所创建的流转
        /// </summary>
        [MaxLength(300)]
        public string CreateByOrder { get; set; }
        /// <summary>
        /// 租赁天数
        /// </summary>
        [MaxLength(300)]
        public int NDays { get; set; }
        
    }
}
